import request from '/@/utils/request';
import qs from 'qs'


export function useChainApi() {
    return {

        /**
         * 添加链配置
         * @param params 
		 * @returns 
         */
        addChain(params:any) {
            return request({
                url:`/CHAIN-EVENT-SCAN-APP/admin/chain/addChain`,
                method: "post",
                data: params,
            });
        },
        
        /**
        * 获取链配置
        * @param params 
		* @returns 
        */
        getChainList(params:any) {
            return request({
                url:`/CHAIN-EVENT-SCAN-APP/admin/chain/getChainList`,
                method: "post",
                data: params,
            });
        },

        /**
        * 编辑链配置
        * @param params 
		* @returns 
        */
        updateChain(params:any) {
            return request({
                url:`/CHAIN-EVENT-SCAN-APP/admin/chain/updateChain`,
                method: "post",
                data: params,
            });
        },

        /**
        * 启用禁用
        * @param params 
		* @returns 
        */
        updateStatus(params:any) {
            let objStr = qs.stringify(params);
            return request({
                url:`/CHAIN-EVENT-SCAN-APP/admin/chain/updateStatus?${objStr}`,
                method: "post"
            });
        },


    }
}